//
//  ClassManageVC.m
//  test
//
//  Created by 朱圳 on 2018/3/16.
//  Copyright © 2018年 朱圳. All rights reserved.
//

#import "ClassManageVC.h"
#import "StuHandleCoureseVC.h"
#import "StuGRNotClassVC.h"
#import "SureVC.h"
#import "RefuseVC.h"
@interface ClassManageVC ()<UITableViewDelegate,UITableViewDataSource>
@property(strong,nonatomic)NSArray*list;
@property(nonatomic,strong)UITableView *tableView;

@end

/**
 研究生端学生端的上课管理界面可以重用...单独建VC为了不搞混
 */
@implementation ClassManageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.list = @[@"等待确认",@"符合",@"不符合",@"未上课"];
    self.title = @"上课管理";
    [self.view addSubview:self.tableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.list.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *SimpleTableIdentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
    if (cell ==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: SimpleTableIdentifier];
        cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
        
    }
    cell.textLabel.text = self.list[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    switch (indexPath.row) {
        case 0:
        {
            StuHandleCoureseVC *vc = [[StuHandleCoureseVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 1:
        {
            SureVC *vc = [[SureVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 2:
        {
            RefuseVC *vc = [[RefuseVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 3:
        {
            StuGRNotClassVC *vc = [[StuGRNotClassVC alloc]init];
            vc.title = self.list[indexPath.row];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;

            
        default:
            break;
    }
}
-(UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.tableFooterView = [[UIView alloc]init];
        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
}
@end

